<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			var n = prompt("给出一个不多于5位的正整数", "");
			document.write("位数：" + n.length + "<br / >");
			for(var i = 0; i < n.length; i++) {
				document.write(n.charAt(i) + "<br / >");
			}
			for(var i = n.length - 1; i >= 0; i--) {
				document.write(n.charAt(i));
			}
		</script>
	</body>

</html>